package com.woniu.petkonwledge.controller;

import com.woniu.common.entity.DogBreed;
import com.woniu.common.entity.ResponseResult;
import com.woniu.petkonwledge.service.DogBreedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/dogBreed")
public class DogBreedController {
    @Autowired
    DogBreedService dogBreedService;
   //查询所有犬种知识

    @RequestMapping("/getAllDogBreedBySize")
    public ResponseResult<List<DogBreed>> getAllDogBreed(Integer size){

        if (dogBreedService.getAllDogBreedBySize(size).equals("")){

            return new ResponseResult<>(500, null, "查询结果为空或查询出错", dogBreedService.getAllDogBreedBySize(size), null);
        }else {
            return new ResponseResult<>(200, null, "ok", dogBreedService.getAllDogBreedBySize(size), null);
        }


    }
}
